package com.example.rabbitmq_server.Page1021;

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

/**
 * @author yifs
 * @version 1.0
 * @date 2023/10/21 11:49
 */
public class Test {

    public static void main(String[] args) {
        String utls =null;
        List<String> list= null;
        List<String> list2= new ArrayList<>();
        list2.add("zz");
        list= Optional.ofNullable(list).orElse(list2);
        for (String s : list) {
            System.out.println(s);
        }

    }
}
